<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>新书推荐</title>
	<link rel="stylesheet" th:href="@{/css/bootstrap.css}">
	<link rel="stylesheet" th:href="@{/css/AdminLTE.css}">
	<link rel="stylesheet" th:href="@{/css/pagination.css}">
	<script th:src="@{/js/jquery.min.js}"></script>
	<script th:src="@{/js/bootstrap.js}"></script>
	<script th:src="@{/js/pagination.js}"></script>
	<script th:src="@{/js/my.js}"></script>
</head>
<body class="hold-transition skin-red sidebar-mini">
<!--数据展示头部-->
<div class="box-header with-border">
	<h3 class="box-title">新书推荐</h3>
</div>
<!--数据展示内容区-->
<div class="box-body">
	<!-- 数据表格 -->
	<table id="dataList" class="table table-bordered table-striped table-hover dataTable text-center">
		<thead>
		<tr>
			<th class="sorting_asc">图书名称</th>
			<th class="sorting">图书作者</th>
			<th class="sorting">出版社</th>
			<th class="sorting">标准ISBN</th>
			<th class="sorting">书籍状态</th>
			<th class="sorting">借阅人</th>
			<th class="sorting">借阅时间</th>
			<th class="sorting">预计归还时间</th>
			<th class="text-center">操作</th>
		</tr>
		</thead>
		<tbody>
		<tr th:each="book : ${books}">
			<td th:text="${book.name}"></td>
			<td th:text="${book.author}"></td>
			<td th:text="${book.press}"></td>
			<td th:text="${book.isbn}"></td>
<!-- 			<td th:switch="${book.status}"> -->
<!-- 				<span th:case="0">可借阅</span> -->
<!-- 				<span th:case="1">借阅中</span> -->
<!-- 				<span th:case="2">归还中</span> -->
			<td>
				<span th:if="${book.status == '0'}">可借阅</span>
				<span th:if="${book.status == '1'}">借阅中</span>
				<span th:if="${book.status == '2'}">归还中</span>
			</td>
			<td th:text="${book.borrower}"></td>
			<td th:text="${book.borrowtime}"></td>
			<td th:text="${book.returntime}"></td>
			<td class="text-center">
				<button type="button" class="btn bg-olive btn-xs" th:if="${book.status == '0'}" data-toggle="modal" data-target="#borrowModal"
								th:attr="onclick='findBookById(' + ${book.id} + ',\'borrow\')'"> 借阅
				</button>
				<button type="button" class="btn bg-olive btn-xs" th:if="${book.status == '1' or book.status == '2'}" disabled="true">借阅</button>
			</td>
		</tr>
		</tbody>
	</table>
	<!-- 数据表格 /-->
</div>
<!-- 数据展示内容区/ -->
<!--引入存放模态窗口的页面-->
<div th:replace="~{book_modal.html :: borrowModal}"></div>
</body>
</html>
